Music Macro Language (MML) is a music description language used in sequencing music on a number of computer and video game system platforms.
MML is also sometimes known as Music Markup Language, by conflation with the XML musical notation markup language of that name. For instance, what the video game Mabinogi refers to as "Music Markup Language" is actually a typical implementation of Music Macro Language.
Contents |
MML originally appeared in Microsoft BASIC and was common in the early 1970s and 1980s on 8-bit and 16-bit era Japanese personal computers.The NEC PC-6001 installed on the Microsoft BASIC and hardware included the Programmable Sound Generator, made to 1981. The MML was especially popular on NEC's personal computers, such as the NEC PC-8801.[1] With the 2001 release of the mck (Music Creation Kit) software for compiling MML to play music on the Nintendo Entertainment System[2], awareness and use of MML has seen some revitalization.[3] MML is presently popular among Japanese electronic musicians[1] and musicians who create chiptunes[4] as a way to write music for the Nintendo Entertainment System.
MML originated as a sub-language of BASIC, then generally included in ROM on micro-computers. A PLAY
statement uses an argument to define a string of tones that the sound-chip played. MML code has a simple text format whereby letters and numbers are used to describe the musical notes to be played.[1] In addition, various implementations of MML add system extensions allowing parameters of audio synthesis to be altered with specialized commands or to simplify the entry of common musical figures such as arpeggios.
Though many platforms feature custom extensions to MML, and letter case requirements and other minor syntactical features vary slightly in some implementations, the fundamental set of syntax rules, commands, and features which defines MML and is present in whole or in part in all implementations is as follows:[1][5]
cdefgab
— The letters a
to g
correspond to the musical pitches and cause the corresponding note to be played. Sharp notes are produced by appending a +
or #
, and flat notes by appending a -
. The length of a note is specified by appending a number representing its length as a fraction of a whole note — for example, c8
represents a C eighth note, and f+2
an F♯ half note.r
— A rest. The length of the rest is specified in the same manner as the length of a note — for example, r1
produces a whole rest.o
— Followed by a number, o
selects the octave the instrument will play in.>
, <
— Used to step up or down one octave.l
— Followed by a number, specifies the default length used by notes or rests which do not explicitly define one. For example, l8 g a b g l16 g a b g
produces a series of four eighth notes followed by a series of four sixteenth notes.v
— Followed by a number, sets the volume of the instrument. The range of values allowed is dependent upon the specific sound hardware being used. Some implementations also allow an ADSR envelope to be applied to the amplitude of each note.t
— Followed by a number, sets the tempo in beats per minute. On hardware with more than one sound channel, it is often possible to set each channel to a different tempo.In addition to these, most implementations add their own keywords and symbols for system-specific enhancements or extensions.
Among others, MML appears in the following programming languages, platforms, and software applications:
PLAY
statement which takes a string argument in the MML format.[6][7][8] The name "Music Macro Language" may originate with GW-BASIC, which provided a facility "to play music by embedding a music macro language into the string data type."[9] The SBasic compiler from the German magazine DOS Extra, produced by DMV Widuch, offers the same PLAY command, and a few-line BASIC programme could be compiled into a small (few KiB) tool to play any MML files (often called *.PLY) given on the command line.PLAY
statement, as did several other implementations of BASIC produced or sold by NEC.[1][10]